﻿<%@ Page Language="C#" MasterPageFile="~/Shared/FormPage.Master" AutoEventWireup="true"  StylesheetTheme="GlobleTheme" CodeBehind="UserPerformanceView.aspx.cs" Inherits="Runda.CMS.Portal.Finiance.UserPerformanceView" Title="客户应收账款" %>
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<%@ Register Assembly="RadAjax.Net2" Namespace="Telerik.WebControls" TagPrefix="rad" %>
<%@ Register Assembly="RadGrid.Net2" Namespace="Telerik.WebControls" TagPrefix="rad" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server"> 

<script src="../Content/global.js" type="text/javascript"></script> 
<script src="../Content/jquery-1.3.2.min.js" type="text/javascript"></script>     
    <link href="../Content/global.css" rel="stylesheet" type="text/css" />
    <link href="../Content/Menu/Menu.css" rel="stylesheet" type="text/css" /> 
    <link href="../Content/Find/find.css" rel="stylesheet" type="text/css" />
    <link href="../Content/Pager.css" rel="stylesheet" type="text/css" />
     <script type="text/javascript"> 
     
         function OnRowDblClick(sender, eventArgs) {

             //alert("DblClick on row instance: " + eventArgs.get_itemIndexHierarchical());

         }
         function exportxls() {
             document.getElementById("<%=btnExportExcel.ClientID %>").click();
         }
         $(function() {

             var CustSum = $('#<%=hfcustsum.ClientID %>').val();
             var NatSum = $('#<%=hfNatSUm.ClientID %>').val();
             var ExchSum = $('#<%=hfExchSum.ClientID %>').val();
             var AccountPayable = $('#<%=hfAccountPayable.ClientID %>').val();
             var Reward = $('#<%=hfReward.ClientID %>').val();
             var Fine = $('#<%=hfFine.ClientID %>').val();

             $('#ctl00_cphFormArea_gridList_ctl01').append("<tr class='GridFooter_OCM' style='white-space:nowrap;text-align:left;'><td width='260px'>合计：" + CustSum + "个客户</td><td width='30px'></td><td width='120px'>" + NatSum + "</td><td width='120px'>" + ExchSum + "</td><td width='120px'>" + AccountPayable + "</td><td width='120px'>" + Reward + "</td><td width='120px'>" + Fine + "</td><td width='60px'></td></tr>");
         })
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cphFormArea" runat="server">

 <div class="Container">         
         <table class="mnubar" cellspacing="0" cellpadding="0">
            <tbody>
                <tr>
                    <td style="padding-left: 5px" nowrap>
                        <b>列表</b>
                    </td>
                    <td style="padding-left: 5px">
                        <img src="../Content/Grid/separator.gif">
                    </td>
                    <td class="icMenu" nowrap> 
                    </td>
                    <td class="icMenu mnuRight" nowrap>
                    <span class="menu" onclick="return exportxls();"><span class="mnuBtn">导出(Excel)</span></span> 
                    </td>
                </tr>
            </tbody>
        </table>       
        <div style="border-bottom: #c2c2bf 1px solid; border-top: #969693 1px solid">
        </div>
            <asp:Panel runat="server" ID="panel1"> 
                <rad:RadGrid runat="server" ID="gridList" EnableAJAX="True" 
                    EnableAJAXLoadingTemplate="True"  AutoGenerateColumns="False" AllowPaging ="false"
                    AllowSorting="True" onitemdatabound="gridList_ItemDataBound" 
                    onsortcommand="gridList_SortCommand" GridLines="None">
                    <ClientSettings EnableClientKeyValues="True">
                        <Selecting AllowRowSelect="True" />
                        <ClientEvents OnRowDblClick="OnRowDblClick" />
                         <Resizing AllowColumnResize="true" />
                    </ClientSettings>
                    <AJAXLoadingTemplate>
                        加载中...
                    </AJAXLoadingTemplate>
                    <MasterTableView DataKeyNames="cCusCode">
                        <Columns> 
                           <rad:GridBoundColumn HeaderText="客户名称" DataField="CustomerName"  AllowSorting="true"><ItemStyle Width="260px" /></rad:GridBoundColumn>
                           <rad:GridBoundColumn HeaderText="账龄(月)" DataField="Age"  AllowSorting="true"><ItemStyle Width="30px" /></rad:GridBoundColumn>
                            <rad:GridBoundColumn HeaderText="发票额" DataField="iNatSum" DataFormatString="{0:N}"  AllowSorting="true"><ItemStyle Width="120px" /></rad:GridBoundColumn>
                            <rad:GridBoundColumn HeaderText="累计收款" DataField="iExchSum" DataFormatString="{0:N}"  AllowSorting="true"><ItemStyle Width="120px" /></rad:GridBoundColumn>
                        
                            <rad:GridBoundColumn HeaderText="应收款" DataField="AccountPayable" DataFormatString="{0:N}"  AllowSorting="true"><ItemStyle Width="120px" /></rad:GridBoundColumn>
                              <rad:GridBoundColumn HeaderText="奖励" DataField="Reward" DataFormatString="{0:N}"  AllowSorting="true"><ItemStyle Width="120px" /></rad:GridBoundColumn>
                            <rad:GridBoundColumn HeaderText="罚息" DataField="Fine" DataFormatString="{0:N}"  AllowSorting="true"><ItemStyle Width="120px" /></rad:GridBoundColumn>
                             <rad:GridTemplateColumn HeaderText="操作">
                                <ItemTemplate>
                                    <asp:LinkButton ID="lnkbtnView" runat="server">查看</asp:LinkButton>
                                </ItemTemplate>
                            </rad:GridTemplateColumn>
                        </Columns>
                    </MasterTableView>
                </rad:RadGrid>  
                   <webdiyer:AspNetPager ID="AspNetPager1" runat="server" CssClass="paginator"   PageSize="20" 
                                CurrentPageButtonClass="cpb" 
                                CustomInfoHTML="第%CurrentPageIndex%页，共%PageCount%页，每页%PageSize%条" 
                                FirstPageText="首页" LastPageText="尾页" NextPageText="下一页" PrevPageText="上一页" 
                                ShowCustomInfoSection="Left" Width="100%" LayoutType="Table"  
                                SubmitButtonClass="but" SubmitButtonText="转到" 
                 onpagechanged="AspNetPager1_PageChanged">
                            </webdiyer:AspNetPager>    
             </asp:Panel>
         </div>
         <asp:HiddenField ID="hfcustsum" runat="server" />
        <asp:HiddenField ID="hfNatSUm" runat="server" />
        <asp:HiddenField ID="hfExchSum" runat="server" />
        <asp:HiddenField ID="hfAccountPayable" runat="server" />
        <asp:HiddenField ID="hfReward" runat="server" />
        <asp:HiddenField ID="hfFine" runat="server" />
        <asp:Button ID="btnExportExcel" runat="server" Text="Button" style="display:none" onclick="btnExportExcel_Click" />
</asp:Content>
